package rpd.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import rpd.model.TbSchoolExperience;
import rpd.model.TbSchoolExperienceExample;
import rpd.model.TbSchoolExperienceKey;
import rpd.model.TbSchoolExperienceWithBLOBs;

public interface TbSchoolExperienceMapper {
    long countByExample(TbSchoolExperienceExample example);

    int deleteByExample(TbSchoolExperienceExample example);

    @Delete({
        "delete from tb_school_experience",
        "where id = #{id,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(TbSchoolExperienceKey key);

    @Insert({
        "insert into tb_school_experience (id, start_time, ",
        "end_time, resume_id, name, ",
        "duty, path, ",
        "describe)",
        "values (#{id,jdbcType=CHAR}, #{startTime,jdbcType=DATE}, ",
        "#{endTime,jdbcType=DATE}, #{resumeId,jdbcType=CHAR}, #{name,jdbcType=LONGVARCHAR}, ",
        "#{duty,jdbcType=LONGVARCHAR}, #{path,jdbcType=LONGVARCHAR}, ",
        "#{describe,jdbcType=LONGVARCHAR})"
    })
    int insert(TbSchoolExperienceWithBLOBs record);

    int insertSelective(TbSchoolExperienceWithBLOBs record);

    List<TbSchoolExperienceWithBLOBs> selectByExampleWithBLOBs(TbSchoolExperienceExample example);

    List<TbSchoolExperience> selectByExample(TbSchoolExperienceExample example);

    @Select({
        "select",
        "id, start_time, end_time, resume_id, name, duty, path, describe",
        "from tb_school_experience",
        "where id = #{id,jdbcType=CHAR}"
    })
    @ResultMap("rpd.mapper.TbSchoolExperienceMapper.ResultMapWithBLOBs")
    TbSchoolExperienceWithBLOBs selectByPrimaryKey(TbSchoolExperienceKey key);

    int updateByExampleSelective(@Param("record") TbSchoolExperienceWithBLOBs record, @Param("example") TbSchoolExperienceExample example);

    int updateByExampleWithBLOBs(@Param("record") TbSchoolExperienceWithBLOBs record, @Param("example") TbSchoolExperienceExample example);

    int updateByExample(@Param("record") TbSchoolExperience record, @Param("example") TbSchoolExperienceExample example);

    int updateByPrimaryKeySelective(TbSchoolExperienceWithBLOBs record);

    @Update({
        "update tb_school_experience",
        "set start_time = #{startTime,jdbcType=DATE},",
          "end_time = #{endTime,jdbcType=DATE},",
          "resume_id = #{resumeId,jdbcType=CHAR},",
          "name = #{name,jdbcType=LONGVARCHAR},",
          "duty = #{duty,jdbcType=LONGVARCHAR},",
          "path = #{path,jdbcType=LONGVARCHAR},",
          "describe = #{describe,jdbcType=LONGVARCHAR}",
        "where id = #{id,jdbcType=CHAR}"
    })
    int updateByPrimaryKeyWithBLOBs(TbSchoolExperienceWithBLOBs record);

    @Update({
        "update tb_school_experience",
        "set start_time = #{startTime,jdbcType=DATE},",
          "end_time = #{endTime,jdbcType=DATE},",
          "resume_id = #{resumeId,jdbcType=CHAR}",
        "where id = #{id,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(TbSchoolExperience record);
}